<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <link href="../style/main.css" type="text/css" rel="stylesheet">
                <link href="../style/register.css" type="text/css" rel="stylesheet">
        <script type="text/javascript" src="../script/jquery-1.8.2.js"></script>
        <script type="text/javascript" src="../script/register.js"></script>
</head>

<body>

 <header>
        <?php
        session_start();
        mysql_connect("localhost:3306", "root", "16886611");
        mysql_select_db("digitalsales");
        if(isset($_GET["action"])){
            if($_GET["action"]=="logout"){
               $_SESSION["username"]=NULL;
            }
        }
        if(!isset($_SESSION["username"])||$_SESSION["username"]==NULL){
        echo '<ul>
                 <li>
                    <p><a href="../index.php">Homepage</a></p>
                  </li>
                </ul>';
        }else{
            echo '<ul>
                <li id="logout">
                  <p><a href="../PhpProject1/index.php?action=logout">Log out</a></p>
                </li>
                 <li>
                    <p><a href="../PhpProject1/index.php?action=logout">My Account</a></p>
                  </li>
                  <li>
                    <p><a href="../PhpProject1/index.php?action=logout">My Orders</a></p>
                  </li>
                  <li>
                    <p>Welcome back,'.$_SESSION["username"].'!</p>
                  </li>
                </ul>';
        }
        
        ?>
        </header>

<div id="register" class="MainPanel">

Register<br />

</div>

<div id="customer_type" class="MainPanel">

<input id="business_radio" type="radio" name="customertype" onclick="show('business_reg', this), hide('home_reg', this)"/> Business Customer <br />
<input id="home_radio" type="radio" name="customertype" onclick="show('home_reg', this), hide('business_reg', this)"/> Home Customer <br />

</div>

    <div id="business_reg" class="MainPanel">

  
            
    <form action="business_insert.php" method="post">

  <table>

<tr>
<th>Username</th>
<td><input type="text" style="height: 26px;" name="username" size="30"/></td>
</tr>

<tr>
<th>Password</th>
<td><input type="password" style="height: 26px;" name="password" size="30"/></td>
</tr>

<tr>
<th>Company Name</th>
<td><input type="input" style="height: 26px;" name="companyname" size="30"/></td>
</tr>

<tr>
<th>Street</th>
<td><input type="input" style="height: 26px;" name="street" size="30"/></td>
</tr>

<tr>
<th>City</th>
<td><input type="input" style="height: 26px;" name="city" size="30"/></td>
</tr>

<tr>
<th>State</th>
<td><input type="input" style="height: 26px;" name="state" size="30"/></td>
</tr>

<tr>
<th>Zip</th>
<td><input type="input" style="height: 26px;" name="zip" size="30"/></td>
</tr>


<tr>
<th>Business Category</th>    

<td>
<?php 
$sql="SELECT BUSINESS_TYPE FROM business_types";
$result=mysql_query($sql); 
echo "<select style='width: 168pt;' name='BusinessCategory'>";
while( $row = mysql_fetch_array( $result ) ) {
  echo "<option value='$row[BUSINESS_TYPE]'>$row[BUSINESS_TYPE]</option>";
}
echo "</select>";
?>
</td>
</tr>

<tr>
<th>Annual Income</th>
<td><input type="text" style="height: 26px;" name="income" size="30"/></td>
<tr>

<tr>
<th></th>
<td><input type="submit" id="submit_button" value="Submit"><td>
</tr>

  </table>

</form>

    

</div>

<div id="home_reg" class="MainPanel">

<form action="home_insert.php" method="post">

<table>

<tr>
<th>Username</th>
<td><input type="text" style="height: 26px;" name="username" size="30"/></td>
</tr>

<tr>
<th>Password</th>
<td><input type="password" style="height: 26px;" name="password" size="30"/></td>
</tr>

<tr>
<th>Name</th>
<td><input type="input" style="height: 26px;" name="name" size="30"/></td>
</tr>

<tr>
<th>Street</th>
<td><input type="input" style="height: 26px;" name="street" size="30"/></td>
</tr>

<tr>
<th>City</th>
<td><input type="input" style="height: 26px;" name="city" size="30"/></td>
</tr>

<tr>
<th>State</th>
<td><input type="input" style="height: 26px;" name="state" size="30"/></td>
</tr>

<tr>
<th>Zip</th>
<td><input type="input" style="height: 26px;" name="zip" size="30"/></td>
</tr>

<tr>
<th>Gender</th>
<td>
<select style="width: 168pt;" name="gender">
<option value="">Select your gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</td>
</tr>

<tr>
<th>Marriage Status</th>
<td>
<select style="width: 168pt;" name="MarriageStatus">
<option value="">Select your status</option>
<option value="Married">Married</option>
<option value="Unmarried">Unmarried</option>
</select>
</td>
</tr>

<tr>
<th>Age</th>
<td><input type="text" style="height: 26px;" name="age" size="30"/></td>
</tr>

<tr>
<th>Annual Income</th>
<td><input type="text" style="height: 26px;" name="income" size="30"/></td>
</tr>

<tr>
<th></th>
<td><input type="submit" id="submit_button" value="Submit"></td>
</tr>

</table>

</form>

</div>
        </div>
</body>

</html>